﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ZPod.MTG.Windows
{
	class CurrentCardDialog : CardDetailDialog
	{
		#region Singleton

		private static CurrentCardDialog Instance = new CurrentCardDialog();

		private CurrentCardDialog() : base(new Card())
		{
			this.FormClosing += new FormClosingEventHandler(CurrentCardDialog_FormClosing);
		}

		#endregion

		#region Private Methods

		void CurrentCardDialog_FormClosing(object sender, FormClosingEventArgs e)
		{
			if (e.CloseReason == CloseReason.UserClosing)
			{
				e.Cancel = true;
				this.Hide();
			}
		}

		#endregion

		#region Public Methods

		public static void ShowCurrentCardDialog(Form mdiParent)
		{
			Instance.MdiParent = mdiParent;
			Instance.Show();
		}

		public static void HideCurrentCardDialog()
		{
			Instance.Hide();
		}

		public static void SetCard(Card card)
		{
			Instance.Card = card;
		}

		#endregion
	}
}
